import service from "@/utils/request"

import LoginWork from "@/utils/LoginWork"
// 部件查询
export const ComponentQuery = () => {
    return service.get<any,any>(`/label/plan/getCustomList`)
}

// 型体工厂查询
export const styleQuery = () => {
    return service.get<any,any>(`/label/plan/getStyleList`)
}

// 主体查询
export const mainQuery = (parms:any) => {
    return service.post<any,any>(`/label/plan/ComponentLabelQuery`,parms)
}

// 明细查询
export const detailEnquiry = (parms:any) => {
    return service.post<any,any>(`/label/plan/LabelDetails`,parms)
}

// 号码查询
export const sizeQuery = (lotNo:string) => {
    return service.post<any,any>(`/batch/plan/BatchNumberDetails?lotNo=${lotNo}`)
}

// 生成轮次标签
export const GenerateARotationLabel = (lotNo:string,override:string) =>{
    return LoginWork.post<any,any>(`/label/plan/generate/check?lotNo=${lotNo}&override=${override}`)
}

// 删除轮次标签
export const deleteLotNo = (lotNo:string) => {
    return LoginWork.post<any,any>(`/label/plan/generate/delete?lotNo=${lotNo}`)
}

// 打印查询
export const printQuery = (lotNo:string) => {
    return service.post<any,any>(`/label/plan/set/list?lotNo=${lotNo}`)
}

// 号码查询
export const sizeQuery1 = (lotNo:string) => {
    return service.post<any,any>(`/batch/plan/BatchNumberDetails?lotNo=${lotNo}`)
}

// 冲裁部位查询
export const partName = (lotNo:string) => {
    return service.post<any,any>(`/label/plan/set/list?lotNo=${lotNo}`)
}

// 确定
export const confirm = (lotNo:any,parms:any) => {
    return LoginWork.post<any,any>(`/label/plan/generate/${lotNo}`,parms)
}

// 打印标签
export const printCode = (lotNo:string) => {
    return service.get<any,any>(`/label/plan/loadMaxlsNo?lotNo=${lotNo}`)
}

// 打印
export const detailEnquiry1 = (parms:any) => {
    parms.lsEnd = parms.lsEnd === null ? "" : parms.lsEnd
    return LoginWork.post<any,any>(`/label/plan/printLabel?lotNo=${parms.lotNo}&partNames=${parms.partNames}&lsFrom=${parms.lsFrom}&lsEnd=${parms.lsEnd}&sizeNos=${parms.sizeNos}`)
}